<head>
    <link rel="stylesheet" type="text/css" href="__CSS__/float_window.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/tools.css" />
    <link href="__CSS__/toastr.css" rel="stylesheet" />
    <script src="__JS__/toastr.js"></script>
    <link rel="stylesheet" type="text/css" href="__CSS__/bootcssButtons.css" />


    <script>
        function sendFeedback(userId) {
            var feedbackInfo = $('#feedbackInfo').val();
            var re = new RegExp("^[ ]+$");

            if (!re.test(feedbackInfo) && feedbackInfo != "" && feedbackInfo != null) {

                $.post("__PUBLIC__/index/index/addFeedback", {
                    feedbackInfo: $('#feedbackInfo').val(),
                    userId: userId
                }, function() {
                    //显示一个信息没有标题
                    toastr.success('反馈已成功发送，感谢使用~');
                    setTimeout(function() {
                        toastr.clear();
                    }, 2000);
                });
            } else {
                toastr.error('反馈不能为空~');
                setTimeout(function() {
                    toastr.clear();
                }, 2000);
            }
        }

        function showFeedback() {
            $('#showdiv_F').show(); //显示弹窗
            $('#cover_F').css('display', 'block'); //显示遮罩层
            $('#cover_F').css('height', '100%'); //设置遮罩层的高度为当前页面高度
        }

        // 关闭弹窗
        function closeFeedback() {
            $('#showdiv_F').hide(); //隐藏弹窗
            $('#cover_F').css('display', 'none'); //隐藏遮罩层
        }
    </script>
</head>

<body>

    <!--<div style="height:1000px;"></div>-->

    <div class="guide">
        <div class="guide-wrap">
            <!--<a href="#" class="edit" title="发新帖"><span>发新帖</span></a>
        <a href="#" class="find" title="找论坛"><span>找论坛</span></a>-->
            {if condition="isset($_COOKIE['user']) "}
            <a href="javascript:showFeedback()" class="report" title="反馈"><span>反馈</span></a> {/if}
            <a href="javascript:window.scrollTo(0,0)" class="top" title="回顶部"><span>回顶部</span></a>
        </div>
    </div>



    {if condition="isset($_COOKIE['user']) "}

    <!--以下为添加反馈时的弹窗相关-->
    <!-- 遮罩层 -->
    <div id="cover_F" class="cover"></div>
    <!-- 弹窗 -->
    <div id="showdiv_F" class="showdiv" style="height: 250px;">
        <!-- 标题 -->
        <div class="showdiv_title">
            意见和反馈
        </div>
        <!-- 内容 -->
        <div class="showdiv_prompt">
            请留下您的宝贵意见或反馈：

            <div>
                <textarea required id="feedbackInfo" style="height: 100px;width: 400px;margin-top: 20px;"></textarea>
            </div>
        </div>

        <!-- 按钮 -->
        <div class="button button-medium " onclick="closeFeedback()" style="position: absolute;left: 25%;top: 80%;">
            取消</div>
        <div id="next_step_btn" onclick="sendFeedback('{$_COOKIE['user']}')" class="button button-action button-medium" style="position:absolute;left: 50%;top: 80%;">
            发送</div>

    </div>

    {/if}

</body>